var __globalThis =
  typeof __vd_version_info__ !== "undefined" &&
  typeof __vd_version_info__.globalThis !== "undefined"
    ? __vd_version_info__.globalThis
    : window;
var __mainPageFrameReady__ =
  __globalThis.__mainPageFrameReady__ || function () {};
var __pageFrameStartTime__ = Date.now();
var __wxAppCode__ = __wxAppCode__ || {};
var __WXML_GLOBAL__ = __WXML_GLOBAL__ || {
  entrys: {},
  defines: {},
  modules: {},
  ops: [],
  wxs_nf_init: undefined,
  total_ops: 0,
};
var __GWX_GLOBAL__ = __GWX_GLOBAL__ || {};

__wxCodeSpace__.batchAddCompiledScripts(function (R, D, Q, gdc) {});

var noCss =
  typeof __vd_version_info__ !== "undefined" &&
  __vd_version_info__.noCss === true;

if (!noCss) {
  const BASE_DEVICE_WIDTH = 750;
  const isIOS = navigator.userAgent.match("iPhone");
  let deviceWidth = window.screen.width || 375;
  let deviceDPR = window.devicePixelRatio || 2;

  const checkDeviceWidth = () => {
    const newDeviceWidth = window.screen.width || 375;
    const newDeviceDPR = window.devicePixelRatio || 2;
    const newDeviceHeight = window.screen.height || 375;

    if (
      window.screen.orientation &&
      /^landscape/.test(window.screen.orientation.type || "")
    ) {
      deviceWidth = newDeviceHeight;
    } else {
      deviceWidth = newDeviceWidth;
    }

    deviceDPR = newDeviceDPR;
  };

  checkDeviceWidth();

  const eps = 1e-4;

  const transformRPX = (number, newDeviceWidth) => {
    if (number === 0) return 0;
    number = Math.floor(
      (number / BASE_DEVICE_WIDTH) * (newDeviceWidth || deviceWidth) + eps
    );
    if (number === 0) {
      return deviceDPR === 1 || !isIOS ? 1 : 0.5;
    }
    return number;
  };

  window.__rpxRecalculatingFuncs__ = window.__rpxRecalculatingFuncs__ || [];
  var __COMMON_STYLESHEETS__ = __COMMON_STYLESHEETS__ || {};

  const setCssToHead = (file, _xcInvalid, info = {}) => {
    const Ca = {};
    const _C = __COMMON_STYLESHEETS__;

    const makeup = (file, opt) => {
      const isString = typeof file === "string";
      if (isString && Ca.hasOwnProperty(file)) return "";
      if (isString) Ca[file] = 1;

      const ex = isString ? _C[file] : file;
      let res = "";

      for (let i = ex.length - 1; i >= 0; i--) {
        const content = ex[i];
        if (typeof content === "object") {
          const op = content[0];
          if (op === 0) {
            res = transformRPX(content[1], opt.deviceWidth) + "px" + res;
          } else if (op === 1) {
            res = opt.suffix + res;
          } else if (op === 2) {
            res = makeup(content[1], opt) + res;
          }
        } else {
          res = content + res;
        }
      }
      return res;
    };

    const styleSheetManager = window.__styleSheetManager2__;
    const rewritor = (suffix = "", opt = {}, style) => {
      opt.suffix = suffix;

      if (opt.allowIllegalSelector !== undefined && _xcInvalid !== undefined) {
        if (opt.allowIllegalSelector) {
          console.warn("For developer:" + _xcInvalid);
        } else {
          console.error(_xcInvalid);
        }
      }

      Ca = {};
      const css = makeup(file, opt);

      if (styleSheetManager) {
        const key = (info.path || Math.random()) + ":" + suffix;
        if (!style) {
          styleSheetManager.addItem(key, info.path);
          window.__rpxRecalculatingFuncs__.push((size) => {
            opt.deviceWidth = size.width;
            rewritor(suffix, opt, true);
          });
        }
        styleSheetManager.setCss(key, css);
        return;
      }

      if (!style) {
        const head = document.head || document.getElementsByTagName("head")[0];
        style = document.createElement("style");
        style.type = "text/css";
        style.setAttribute("wxss:path", info.path);
        head.appendChild(style);
        window.__rpxRecalculatingFuncs__.push((size) => {
          opt.deviceWidth = size.width;
          rewritor(suffix, opt, style);
        });
      }

      if (style.styleSheet) {
        style.styleSheet.cssText = css;
      } else {
        if (style.childNodes.length === 0) {
          style.appendChild(document.createTextNode(css));
        } else {
          style.childNodes[0].nodeValue = css;
        }
      }
    };

    return rewritor;
  };

  setCssToHead([])();
  setCssToHead(
    [
      "body{background-color:#252630;color:#333;font-family:Helvetica Neue,Helvetica,sans-serif;font-size:",
      [0, 28],
      "}",
    ],
    "Some selectors are not allowed in component wxss, including tag name selectors, ID selectors, and attribute selectors.(./app.wxss:1:1)",
    { path: "./app.wxss" }
  )();
}

__mainPageFrameReady__();
var __pageFrameEndTime__ = Date.now();
